package com.taotao.builder;

/**
 * @Author: wangjin
 * @CreateTime: 2022-08-06  13:14
 */
public class TaoTaoBuilder {
    private String url;
    private String method;
    private Long timeout;
    private String body;

    public String getUrl() {
        return url;
    }

    public TaoTaoBuilder setUrl(String url) {
        this.url = url;
        return this;
    }

    public String getMethod() {
        return method;
    }

    public TaoTaoBuilder setMethod(String method) {
        this.method = method;
        return this;
    }

    public Long getTimeout() {
        return timeout;
    }

    public TaoTaoBuilder setTimeout(Long timeout) {
        this.timeout = timeout;
        return this;
    }

    public String getBody() {
        return body;
    }

    public TaoTaoBuilder setBody(String body) {
        this.body = body;
        return this;
    }

    public TaoTaoHttpClient build() {
        return new TaoTaoHttpClient(this);
    }

    public static void main(String[] args) {
        TaoTaoHttpClient taoClient = new TaoTaoBuilder().setUrl("http://www.baidu.com").setBody("tapotaio").build();
        TaoTaoHttpClient taoClient1 = new TaoTaoBuilder().setUrl("http://www.baidu.com").setBody("tapotaio").setMethod("main").build();

        TaoTaoHttpClient taoClient2 = new TaoTaoBuilder().setBody("tapotaio").setMethod("main").build();

        System.out.println(taoClient);
        System.out.println(taoClient1);
        System.out.println(taoClient2);
    }
}
